package org.hhchat.leetcode.array;

/**
 * Created this one by HMH on 2017/10/3.
 */
public class code485_easy {

    static class Solution {
        public int findMaxConsecutiveOnes(int[] nums) {
            int count = 0;
            int max = 0;
            for(int i=0;i<nums.length;i++) {
                if (nums[i] == 0) {
                    max = Math.max(count, max);
                    count=0;
                }
                else{
                    count++;
                }
            }
            max = Math.max(count, max);
            return max;
        }
    }

    public static void main(String[] args){

    }

}
